﻿using System;
using System.ComponentModel;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.Common;
using HumanManagement.BusinessObjects;
using HumanManagement.DataAccess;

namespace HumanManagement.BusinessLogic
{
	public class MaritalStatusCategoryBL
	{

		#region ***** Init Methods ***** 
		MaritalStatusCategoryDA objMaritalStatusCategoryDA;
		public MaritalStatusCategoryBL()
		{
			objMaritalStatusCategoryDA = new MaritalStatusCategoryDA();
		}
		#endregion

		#region ***** Get Methods ***** 
		/// <summary>
		/// Get MaritalStatusCategory by id
		/// </summary>
		/// <param name="id">ID</param>
		/// <returns>MaritalStatusCategory</returns>
		public MaritalStatusCategory GetByID(int id)
		{
			return objMaritalStatusCategoryDA.GetByID(id);
		}

		/// <summary>
		/// Get all of MaritalStatusCategory
		/// </summary>
		/// <returns>List<<MaritalStatusCategory>></returns>
		public List<MaritalStatusCategory> GetList()
		{
			string cacheName = "lstMaritalStatusCategory";
			if( ServerCache.Get(cacheName) == null )
			{
				ServerCache.Insert(cacheName, objMaritalStatusCategoryDA.GetList(), "MaritalStatusCategory");
			}
			return (List<MaritalStatusCategory>) ServerCache.Get(cacheName);
		}

		/// <summary>
		/// Get DataSet of MaritalStatusCategory
		/// </summary>
		/// <returns>DataSet</returns>
		public DataSet GetDataSet()
		{
			string cacheName = "dsMaritalStatusCategory";
			if( ServerCache.Get(cacheName) == null )
			{
				ServerCache.Insert(cacheName, objMaritalStatusCategoryDA.GetDataSet(), "MaritalStatusCategory");
			}
			return (DataSet) ServerCache.Get(cacheName);
		}


		/// <summary>
		/// Get all of MaritalStatusCategory paged
		/// </summary>
		/// <param name="recperpage">recperpage</param>
		/// <param name="pageindex">pageindex</param>
		/// <returns>List<<MaritalStatusCategory>></returns>
		public List<MaritalStatusCategory> GetListPaged(int recperpage, int pageindex)
		{
			return objMaritalStatusCategoryDA.GetListPaged(recperpage, pageindex);
		}

		/// <summary>
		/// Get DataSet of MaritalStatusCategory paged
		/// </summary>
		/// <param name="recperpage">recperpage</param>
		/// <param name="pageindex">pageindex</param>
		/// <returns>DataSet</returns>
		public DataSet GetDataSetPaged(int recperpage, int pageindex)
		{
			return objMaritalStatusCategoryDA.GetDataSetPaged(recperpage, pageindex);
		}





		#endregion

		#region ***** Add Update Delete Methods ***** 
		/// <summary>
		/// Add a new MaritalStatusCategory within MaritalStatusCategory database table
		/// </summary>
		/// <param name="obj_maritalstatuscategory">MaritalStatusCategory</param>
		/// <returns>key of table</returns>
		public int Add(MaritalStatusCategory obj_maritalstatuscategory)
		{
			ServerCache.Remove("MaritalStatusCategory", true);
			return objMaritalStatusCategoryDA.Add(obj_maritalstatuscategory);
		}

		/// <summary>
		/// updates the specified MaritalStatusCategory
		/// </summary>
		/// <param name="obj_maritalstatuscategory">MaritalStatusCategory</param>
		/// <returns></returns>
		public void Update(MaritalStatusCategory obj_maritalstatuscategory)
		{
			ServerCache.Remove("MaritalStatusCategory", true);
			objMaritalStatusCategoryDA.Update(obj_maritalstatuscategory);
		}

		/// <summary>
		/// Delete the specified MaritalStatusCategory
		/// </summary>
		/// <param name="id">ID</param>
		/// <returns></returns>
		public void Delete(int id)
		{
			ServerCache.Remove("MaritalStatusCategory", true);
			objMaritalStatusCategoryDA.Delete(id);
		}
		#endregion
	}
}
